package com.metroinfo.infrastructure;

import java.util.concurrent.ConcurrentHashMap;

import com.metroinfo.infrastructure.keys.StationInfoDataKey;
import com.metroinfo.infrastructure.value.StationInfoValue;
import com.metroinfo.interfaces.DataStructInterface;

public class StationInfoData implements DataStructInterface{

	ConcurrentHashMap<StationInfoDataKey, StationInfoValue> stationInfoData = new ConcurrentHashMap<StationInfoDataKey, StationInfoValue>();
	
	public StationInfoData (int i){
		for (int g = 0; g<i;g++)
		{
			StationInfoDataKey stationInfoDataKey = new StationInfoDataKey(Integer.valueOf(g));
			StationInfoValue stationInfoValue = new StationInfoValue(Integer.valueOf(g) ,true, "sada");
			
			stationInfoData.put(stationInfoDataKey, stationInfoValue);
		}
	}

	@Override
	public Object getValue(Object o) {
		return stationInfoData.get((StationInfoDataKey)o);
	}

	@Override
	public boolean isExists(Object o) {
		// TODO Auto-generated method stub
		return stationInfoData.get((StationInfoDataKey)o)==null? false: true;
	}

	@Override
	public boolean refresh() {
		// TODO Auto-generated method stub
		return true;
	}
	
}
